/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tutorial.DesignPatterns.Observer.listeners;

import tutorial.DesignPatterns.Observer.observer.CaineEvent;
import tutorial.DesignPatterns.Observer.observer.CaineListener;

/**
 * O implementare a interfetei CaineListener
 * 
 * @author Boogie
 */
public class Stapan implements CaineListener{
    private final String name;

    public Stapan(String name) {
        this.name = name;
    }
    /**
     * Modul in care se trateaza evenimetele publicate de caine
     * In acest caz Clasa aceasta trateza ambele eveminete
     * @param e - Eventul public cat de caine
     */
    @Override
    public void onCaineEvent(CaineEvent e) {
        switch(e.getEventType()){
            case CaineEvent.HUNGRY:
                System.out.println(name+" Feeds dog: "+e.getSource());
                break;
            case CaineEvent.SLEEPY:
                System.out.println(name+" Puts dog: "+e.getSource() + " to bed");
                break;
        }
    }
    
}
